<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets">

    <!--Inicia la composicion de la pagina en la plantilla-->
    <ui:composition template="/resource/template/plantilla.xhtml">

        <!--Segmento que define el contenido del header-->
        <ui:define name="head">
            <h:head>
                <f:loadBundle basename="person.user.label_#{logged.loggedIdiom}"  var="label" />
                <f:loadBundle basename="person.user.message_#{logged.loggedIdiom}" var="message" />
                <f:loadBundle basename="person.user.help_#{logged.loggedIdiom}" var="help" />
                <script>
                    function verificar(dato)
                    {
                        var agree = confirm(dato);
                        if (agree)
                            return true;
                        else
                            return false;
                    }
                </script>
            </h:head>
        </ui:define>

        <!--Segmento que define el contenido de la pagina-->
        <ui:define name="content">
            <h:body>
                <h:outputText value="#{message.m0}" class="label" rendered="#{!access.visit}"/>
                <h:form rendered="#{access.visit}">  
                    <p:growl id="messages" showDetail="true"/>  

                    <div class="field">
                        <h:outputText value="#{label.field1}" class="label"/>
                        <h:inputText value="#{person_user.nombre}" class="textfield" size="25" maxlength="50" required="#{param['required']=='true'}" requiredMessage="#{message.m6}"/>
                    </div>
                    <div class="field">
                        <h:outputText value="#{label.field2}" class="label"/>
                        <h:inputText value="#{person_user.clave}" class="textfield" size="15" maxlength="50" required="#{param['required']=='true'}" requiredMessage="#{message.m6}"/>
                    </div>

                    <div class="field">
                        <h:outputText value="#{label.field3}" class="label"/>
                        <h:inputText value="#{person_user.clave}" class="textfield" size="15" maxlength="50" required="#{param['required']=='true'}" requiredMessage="#{message.m6}"/>
                    </div>

                    <div class="field">
                        <h:outputText value="#{label.field4}" class="label"/>
                        <h:selectOneRadio value="#{person_user.idioma}" class="radioButton">  
                            <f:selectItem itemLabel="#{systemLabel.idiom1}" itemValue="#{systemLabel.idiom1}" />  
                        </h:selectOneRadio>
                    </div>

                    <div class="field">
                        <h:outputText value="#{label.field5}" class="label"/>
                        <h:selectBooleanCheckbox value="#{person_user.activo}" class="checkBox"/>
                    </div>

                    <div class="field">
                        <h:outputText value="#{label.field6}" class="label"/>
                        <p:calendar value="#{person_user.login}" disabled="true" pattern="dd/MM/yy HH:mm:ss" />
                    </div>

                    <div class="field">
                        <h:outputText value="#{label.field7}" class="label"/>
                        <p:calendar value="#{person_user.unLogin}" disabled="true" pattern="dd/MM/yy HH:mm:ss" />  
                    </div>

                    <div class="field">
                        <h:outputText value="#{label.field9}" class="label"/>
                        <p:calendar value="#{person_user.registrado}" disabled="true" pattern="dd/MM/yy HH:mm:ss" />  
                    </div>

                    <h:commandButton value="#{label.button2}" class="button" actionListener="#{person_user.update}" rendered="#{access.update}" onclick="return verificar('#{message.m7}')">
                        <f:param name="required" value="true"/>
                    </h:commandButton>
                </h:form>
            </h:body>
        </ui:define>

        <!--Segemento donde se define un texto de ayuda para que el usuario pueda utilizar el formulario del contenido-->
        <ui:define name="slideHelper">
            <h3>#{help.title1}</h3>
            #{help.detail1a}
            <p>
                #{help.title2}
                <ul>
                    <li>#{help.datail2a}</li>
                </ul>
            </p>
            <p>
                #{help.title3}
                <ul>
                    <li>#{help.datail3a}</li>
                </ul>
            </p>
        </ui:define>
    </ui:composition>
</html>